package org.ayatsuji.launchmode;

import android.content.Intent;
import android.util.Log;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;

public class SingleInstanceActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_single_instance);
        Log.d(getClass().getName(), "create==================== taskid=" + getTaskId() + "");
        // 当前活动是singleInstance模式，所以会在另一个栈中保存，所以打开secondActivity后显示的栈id和当前的不同
        findViewById(R.id.singleinstance_button).setOnClickListener(view -> {
            Intent intent = new Intent(this, SecondActivity.class);
            startActivity(intent);
        });
    }
}